﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <script src="/ViewV5/JS/jquery-1.11.2.min.js"></script>
    <title></title>
    <script>
        function getQueryString(name, defauval) {//获取URL参数,如果获取不到，返回默认值，如果没有默认值，返回空格
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) { return unescape(r[2]); }
            else {
                return defauval || "";
            }
        }
        function setCookie(name, value) {
            var Days = 30;
            var exp = new Date();
            exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
            document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString() + ";path=/";

        }

    </script>
</head>
<body>
    <object id="RTXAX" data="data:application/x-oleobject;base64,fajuXg4WLUqEJ7bDM/7aTQADAAAaAAAAGgAAAA=="
            classid="clsid:5EEEA87D-160E-4A2D-8427-B6C333FEDA4D" viewastext></object>
    <script language="javascript" type="text/javascript">
        var RTXCRoot = RTXAX.GetObject("KernalRoot");   //获取KernalRoot对象
        var rtcData = RTXCRoot.Sign;  //获取签名，并把它赋给rtcData
        var strAccount = RTXCRoot.Account;  //获取用户帐号
        var strSignature = rtcData.GetString("Sign"); //获取rtcData对象的Sign 的内容，也就是用户签名
        var dataID = getQueryString("ID");
        alert(strAccount)
        alert(strSignature)

        if (strAccount && strSignature) {
            $.getJSON('/API/VIEWAPI.ashx?Action=Commanage_RTXDL', { P1: strAccount, P2: strSignature, "ComID": "" }, function (resultData) {
                if (resultData.ErrorMsg == "") {
                    //location.href = 'XXFBChildrenVIEW.html?code=jsjd&user=' + encodeURIComponent(strAccount) + '&sign=' + encodeURIComponent(strSignature);
                    setCookie('szhlcode', resultData.Result);
                    location.href = "XXFBChildrenVIEW.html?ID=" + dataID;
                    setCookie('username', resultData.Result1, 20000);
                } else {
                    alert(resultData.ErrorMsg);
                }
            })
        }
    </script>
</body>
</html>
